<!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link type="text/css" href="/css/cultivateWeb/style/teach.css" rel="stylesheet">
<style>

</style>
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="layui-container">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > <a href="/cultivate/teacher">师资介绍</a> >
            师资详情</p>
        <input th:value="${id}" type="hidden" id="id"/>
    </div>
    <div id="tch">
        <!-- 热门推荐课程 -->
        <div class="rmtjkc aa">
            <div class="xianshi">
                <div id="teach" style="background-color: #fff; width: 1200px; margin: 0 auto">
                </div>
                <div class="kctit" style="margin:30px 0 0 10px">
                    <span>讲授课程</span>
                </div>
                <div class="qiehuan active">
                    <ul class="clear" id="course">
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
</body>
<script>
    $(function () {
        var id = $("#id").val();
        $.ajax({
            url: "/jzApi/teacher/selProDetail",
            type: 'GET',
            data: {
                id: id
            },
            success: function (res) {
                var a = '';
                if (res.data.headPortrait != ""  && res.data.headPortrait != null) {
                    a = res.data.headPortrait;
                } else {
                    a = '/img/timg.jpg'
                }
                var news = '<div id="sz">' +
                    '<img class="tea_2" src="' + a+ '">' +
                    '<div class="tea_1" style="width: 1000px;margin-top: 20px">' +
                    '<div class="title5"><span class="title4">讲师姓名：</span>' + res.data.name + '</div>' +
                    '<div class="title5"><span class="title4">擅长领域：</span>' + res.data.kpointsName + '</div>' +
                    '<div class="title5"><span class="title4">学习、工作经历：</span>' + res.data.experience + '</div>' +
                    '</div>' +
                    '<div style="clear: both"></div></div>';
                $("#teach").html(news);
                if (res.data.courserList == 0) {
                    $("#course").html('<div class="noData">暂无数据</div>');
                } else {
                    var list = res.data.courserList;
                    var course = '';
                    list.forEach(function (item, index) {
                        var a = '';
                        if (item.specialPrice != 0) {
                            a = '¥' + item.specialPrice
                        } else {
                            a = '免费'
                        }
                        course += '<li><a href="/couInfo/couInfo?id=' + item.id + '">' +
                            '<div><img src="' + item.thumbnail + '" alt="图片"></div>' +
                            '<div>' +
                            '<h1>' + item.name + '</h1>' +
                            '<h2><span class="red lf">' + a + '</span></h2>' +
                            '</div>' +
                            '</a></li>'
                    });
                    $("#course").html(course);
                }

            }
        })
    })
</script>
</html>